package cc.yugu.yhdw.webserver.service.hdw;

import cc.yugu.yhdw.common.domain.hdw.Agency;
import cc.yugu.yhdw.common.domain.hdw.AgencyInOutMoney;
import cc.yugu.yhdw.common.entity.pagination.Page;
import cc.yugu.yhdw.webserver.persistence.hdw.AgencyInOutMoneyMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
/**
 * 代理商资金流水业务
 *
 * @Date:Created in 2018/7/5 16:07
 * @Author:
 * @Modified By: zjn 2018/7/5 16:07
 */
@Service
public class AgencyInOutMoneyService {

    @Autowired
    AgencyInOutMoneyMapper agencyInOutMoneyMapper;
    /**
    * 分页查询
    *
    * @Param: [search]
    * @Return: cc.yugu.yhdw.common.entity.pagination.Page
    * @Author By: zjn 2018/7/5  16:07
    */
    public Page findPage(AgencyInOutMoney search) {
        Page page = search.buildPage();
        page.setTotalItems(agencyInOutMoneyMapper.findPageCount(search));
        search.setBeginIndex(page.getOffset());
        page.setResult(agencyInOutMoneyMapper.findPageResult(search));

        return page;
    }

    /**
    * 新增：查询统计代理商不同类型收入
    * 
    * @Param: [agencyId, bizType]
    * @Return: java.util.List<cc.yugu.yhdw.common.domain.hdw.AgencyInOutMoney>
    * @Author By: zjn 2018/8/17  16:55
    */ 
    public List<AgencyInOutMoney> find(Integer agencyId,Integer bizType){
        return agencyInOutMoneyMapper.find(agencyId,bizType);
    }

}
